package instant.news7;

import android.content.Intent;
import android.os.Bundle;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.denzcoskun.imageslider.constants.ScaleTypes;
import com.denzcoskun.imageslider.models.SlideModel;

import java.util.ArrayList;
import java.util.List;

import com.iqraaonline.userss.new_userss.R;
import com.iqraaonline.userss.new_userss.databinding.ActivityMainBinding;

public class MainActivity extends AppCompatActivity {
    ActivityMainBinding binding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityMainBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        ThemeClass.applyTheme(this);
        ThemeDayAndNight.ThemeChange(this,binding.swithchange);


        List<SlideModel> imageList = new ArrayList<>();

        imageList.add(new SlideModel(R.drawable.i, ScaleTypes.FIT));
        imageList.add(new SlideModel(R.drawable.d, ScaleTypes.FIT));
        imageList.add(new SlideModel(R.drawable.h, ScaleTypes.FIT));
        imageList.add(new SlideModel(R.drawable.f, ScaleTypes.FIT));
        imageList.add(new SlideModel(R.drawable.c, ScaleTypes.FIT));

        binding.imageSlider.setImageList(imageList);


        binding.cardView01.setOnClickListener(view -> {
            changeActivity("10");
        });
        binding.cardView02.setOnClickListener(view -> {
            changeActivity("20");
        });
        binding.cardVie03.setOnClickListener(view -> {
            changeActivity("30");
        });
        binding.cardView04.setOnClickListener(view -> {
            ChangerQuizActivity("40");
        });
        binding.cardVie05.setOnClickListener(view -> {
            ChangerQuizActivity("50");
        });
        binding.cardVie06.setOnClickListener(view -> {
            changeActivity("60");
        });
        binding.cardView1.setOnClickListener(view -> {
            changeActivity("70");
        });
        binding.cardView2.setOnClickListener(view -> {
            ChangerQuizActivity("80");
        });
        binding.cardView5.setOnClickListener(view -> {
            changeActivity("90");
        });
        binding.cardView6.setOnClickListener(view -> {
            ChangerQuizActivity("100");
        });
        binding.quizId.setOnClickListener(view -> {
            ChangerQuizActivity("170");
        });
    }// OnCreate bundle end hre


    private void changeActivity(String value){

        Intent intent = new Intent(MainActivity.this, ReadActivity.class);
        intent.putExtra("intent",value);
        startActivity(intent);

    }
    private void ChangerQuizActivity(String value){

        Intent intent = new Intent(MainActivity.this, QuizActivity.class);
        intent.putExtra("intent",value);
        startActivity(intent);

    }
}